home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Modules / BackSpaceModules / Source / QizColorView / QixColorView.h < prev    next >
Text File  |  1991-11-07  |  3KB  |  107 lines

  1.  
  2. #import    <appkit/View.h>
  3. #import    <appkit/graphics.h>
  4.  
  5. /*
  6.  *    This class implements what I've heard called, Qix lines.
  7.  *
  8.  *    Please send any suggestions for improving or correcting this
  9.  *    screen saver to larry@netcom.com.  Have fun!
  10.  *
  11.  */
  12.  
  13. /**********************************************************************/
  14.  
  15. typedef    struct    moveable_point    // All values neccessary to keep track
  16.         {                        // of a moving points position and direction.
  17.  
  18.                 int    x;                // x coordinate of the point.
  19.                 int    y;                // y coordinate of the point.
  20.                 
  21.                 int    x_dir;            // Points "x" direction, LEFT or RIGHT.
  22.                 int    y_dir;            // Points "y" direction, UP or DOWN.
  23.                 
  24.                 float    x_inc;        // Amount to move point in x's direction.
  25.                 float    y_inc;        // Amount to move point in y's direction.
  26.                 
  27.                 float    orig_inc;    // Used to reset x_inc and y_inc.
  28.         }
  29.         MVPOINT;
  30.  
  31.  
  32. typedef    struct    qix_line        // Two moveable points make a moving line.
  33.         {
  34.             MVPOINT    pointA;
  35.             MVPOINT    pointB;
  36.         }
  37.         QIX;
  38.  
  39. /*********************************************************************/
  40.  
  41. @interface QixColorView : View
  42. {
  43.     QIX        head;            // Head Qix values. Drawn in white.
  44.     QIX        tail;            // Tail Qix values. Drawn in black.
  45.     
  46.     int        tailLen;        // Current length of tail.
  47.     
  48.     int        hue;            // current hue of the QIX (0-255)
  49.         // added 11/7/91 by Don Yacktman for COLOR
  50. }
  51.  
  52. /*********************************************************************/
  53.  
  54. //--------------------------------------------------------------//
  55. //                                                                //
  56. - setQixPoint : ( MVPOINT * ) qix;                                //
  57. //                                                                //
  58. //    Sets a movable points next position.                        //
  59. //                                                                //
  60. //--------------------------------------------------------------//
  61.  
  62. //--------------------------------------------------------------//
  63. //                                                                //
  64. - resetQix : ( QIX * ) qix : ( BOOL ) resetControls;            //
  65. //                                                                //
  66. //    Resets a qix points fields to default values.                //
  67. //                                                                //
  68. //--------------------------------------------------------------//
  69.  
  70. //--------------------------------------------------------------//
  71. //                                                                //
  72. - initFrame  : ( const NXRect * ) frameRect;                    //
  73. //                                                                //
  74. //    Calls resetQix to reset the head and tail qix.                 //
  75. //                                                                //
  76. //--------------------------------------------------------------//
  77.  
  78. - (const char *) windowTitle;
  79.  
  80. //--------------------------------------------------------------//
  81. //                                                                //
  82. - drawSelf : ( NXRect * ) r : ( int ) count;                    //
  83. //                                                                //
  84. //    Clears its view to a black background and calls resetQix,    //
  85. //    to reset the head and tail qix to their default values.        //
  86. //                                                                //
  87. //--------------------------------------------------------------//
  88.  
  89. //--------------------------------------------------------------//
  90. //                                                                //
  91. - drawQix : ( QIX ) qix;                                        //
  92. //                                                                //
  93. //    Draws a line between the two points in a qix structure.        //
  94. //                                                                //
  95. //--------------------------------------------------------------//
  96.  
  97. //--------------------------------------------------------------//
  98. //                                                                //
  99. - oneStep;                                                        //
  100. //                                                                //
  101. //    This is it the master method.  This method is the control    //
  102. //    center for animating the qix lines.                            //
  103. //                                                                //
  104. //--------------------------------------------------------------//
  105.  
  106. @end
  107.